﻿using IcicleFramework.Entities;
using Microsoft.Xna.Framework;

namespace IcicleFramework.Components.Actions
{
    public abstract class ImmediateAction : BaseAction
    {
        public ImmediateAction() { }

        public ImmediateAction(ImmediateAction old)
            :base(old)
        { }

        public override void Execute(IGameObject target, IActionData data = null, bool continuous = false)
        {
            Target = target;
            ActionData = data;
            ContinuousActions = continuous;
            PerformingActions = true;
        }

        public override void Update(GameTime gameTime)
        {
            if (PerformingActions)
            {
                Execute(gameTime);
            }
        }
    }
}
